package com.evon.yardmanagement.transformer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.evon.yardmanagement.model.Transporter;
import com.evon.yardmanagement.ui.dto.TransporterDTO;

public class TransporterTransformer {
	public static List<TransporterDTO> transform(List<Transporter> cars) {
		if (cars == null || cars.isEmpty()) {
			return Collections.EMPTY_LIST;
		}
		List<TransporterDTO> listDTO = new ArrayList<TransporterDTO>(cars
				.size());
		for (Transporter car : cars) {
			TransporterDTO transientCar = new TransporterDTO();

			BeanUtils.copyProperties(car, transientCar, new String[] {
					"HSC_ID", "HSC_TS", "HSU_ID", "HSU_TS" });
			listDTO.add(transientCar);
		}
		return listDTO;

	}

}
